#include <cstdio>
#include <stdexcept>

struct ExceptMaker {
  void forget(int x) {
    if (x == 0xFACE) {
      throw std::runtime_error("I'd be glad to make a exception.");
    }
    printf("Forgot 0x%X\n", x);
  }
};

int main(int argc, char **argv) {
  ExceptMaker em;
  try {
    em.forget(0xCAFE);
    em.forget(0xFACE);
    em.forget(0xC0DE);
  } catch (const std::runtime_error &e) {
    printf("Caught exception: %s\n", e.what());
  }
  return 0;
}
